#define _CRT_SECURE_NO_WARNINGS
#include<stdio.h>
#include<string.h>
#include<assert.h>
char* my_strncat(char* arr1, const char* arr2, size_t num)
{
	assert(arr1 && arr2);
	char* ret = arr1;
	while (*arr1)arr1++;
	for (int i = 0; i < num; i++) {
		*(arr1 + i) = *(arr2 + i);
	}
	*(arr1 + num) = '\0';
	return ret;
}
int main()
{
	char arr1[20] = "abcdefg";
	char arr2[20] = "rhmotyi";
	char* pc = my_strncat(arr1, arr2, strlen(arr2));
	printf("%s\n", pc);
	pc = my_strncat(arr1, arr2, strlen(arr2) - 2);
	printf("%s\n", pc);
	return 0;
}